From if statements to machine learning